package com.shunya.diskorganizer.model;

import com.shunya.diskorganizer.tinytypes.Name;
import com.shunya.diskorganizer.tinytypes.Owner;
import com.shunya.diskorganizer.tinytypes.Size;

public class FileMetaData {
    private Name fileName;
    private Size fileSize;
    private Owner ownerName;

    public Name getFileName() {
        return fileName;
    }

    public void setFileName(Name fileName) {
        this.fileName = fileName;
    }

    public Size getFileSize() {
        return fileSize;
    }

    public void setFileSize(Size fileSize) {
        this.fileSize = fileSize;
    }

    public Owner getOwnerName() {
        return ownerName;
    }

    public void setOwnerName(Owner ownerName) {
        this.ownerName = ownerName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FileMetaData metaData = (FileMetaData) o;

        if (!fileName.equals(metaData.fileName)) return false;
        if (!fileSize.equals(metaData.fileSize)) return false;
        if (!ownerName.equals(metaData.ownerName)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = fileName.hashCode();
        result = 31 * result + fileSize.hashCode();
        result = 31 * result + ownerName.hashCode();
        return result;
    }
}
